import 'package:flutter/cupertino.dart';
import 'package:libflutter/net/RDApi.dart';

class RDNetInheritedWidget extends InheritedWidget {
  final RDApi api;

  const RDNetInheritedWidget({
    Key? key,
    required this.api,
    required Widget child,
  }) : super(key: key, child: child);

  @override
  bool updateShouldNotify(RDNetInheritedWidget old) {
    return old.api != api;
  }

  static RDNetInheritedWidget? of(BuildContext context) {
    return context.dependOnInheritedWidgetOfExactType<RDNetInheritedWidget>();
  }
}
